<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>影院</title>
    <link type="text/css" rel="stylesheet" href="../../static/css/style.css"/>
    <script src="/static/script/jquery-1.7.2.js"></script>
    <script>
        $(function (){
            var s = "全部"
            var showingFilms = "正在热映"
            $("#film_a").attr("href","/showFilms?filmState="+showingFilms+"&filmType="+s+"&zone="+s)

            $("#buy_ticket").click(function (){
                location = "/toBuyTicket?filmName={{.NowFilm.FilmName}}"
            });

            $("#message_but").click(function (){
                location = "/toComment?filmName={{.NowFilm.FilmName}}&messageType='0'"
            });

            $(".answer").hide();

            var launchs = document.getElementsByClassName("launch")
            for(var i=0; i<launchs.length; i++) {
                launchs[i].addEventListener("click",function (){
                    //获取评论框ID值
                    var id = $(this).attr("name")
                    //根据ID获取评论框
                    var node = document.getElementById(id)
                    $(node).show()
                })
            }

            var pack_ups = document.getElementsByClassName("pack_up")
            for(var i=0; i<pack_ups.length; i++) {
                pack_ups[i].addEventListener("click",function (){
                    //获取评论框ID值
                    var id = $(this).attr("name")
                    //根据ID获取评论框
                    var node = document.getElementById(id)
                    $(node).hide()
                })
            }
        });
    </script>
</head>
<body>
<!--首行-->
<div id="header">
    <table>
        <tr>
            <td>
                <span><img src="/static/img/logo.png" style="float: left;border-radius: 52px"></span>
                <span id="index_logo"><a href="/" style="color:red;margin-top: 10px;float: left;vertical-align: middle;">猫眼电影</a></span>
            </td>

            <td><a href="/main">首页</a></td>
            <td><a id="film_a">电影</a></td>
            <td style="background-color: cadetblue"><a href="/">影院</a></td>
            <td><a href="/filmList">榜单</a></td>
            <td>
                <form action="/selectFilm" method="post">
                    <input class="search" type="search" placeholder="找影视剧" autocomplete="off" name="filmName"><input class="submit" type="submit" value="搜索">
                </form>
            </td>
            <td><a href="/login">
                {{if .IsLogin}}
                <img src="{{.User.ImgPath}}" style="width: 50px;border-radius: 50px;border: 2px solid darkblue">
                {{else}}
                <img src="/static/img/0.png" style="width: 50px;border-radius: 50px;border: 2px solid darkblue">
                {{end}}
            </a>
            </td>
        </tr>
    </table>
</div>

<!--第一部分-->
<div id="body_head">
    <table id="body_table">
        <tr>
            <td rowspan="2">
                <img src="{{.NowFilm.ImgPath}}">
            </td>
            <td style="font-family: '宋体'">
                <div style="font-size: 30px;">{{.NowFilm.FilmName}}</div><br/>
                <div>{{.NowFilm.FilmType}}</div>
                <div>{{.NowFilm.Zone}}/{{.NowFilm.Duration}}分钟</div>
                <div>{{.NowFilm.ScreenDate}} {{.NowFilm.Zone}}上映</div>
            </td>
        </tr>
        <tr>
            {{if .NowFilm.State}}
            <td><div style="width: 100px;background-color: gray;height: 35px;border: 1px solid black;padding-left: 48px;padding-top: 15px">购 票</div></td>
            {{else}}
            <td><input type="button" value="购 票" id="buy_ticket"></td>
            {{end}}
            <td rowspan="2">
                <p style="font-size: 14px">累计票房</p>
                <div style="font-size: 20px">{{.NowFilm.TicketOffice}} <span style="font-size: 14px">元</span></div>
            </td>
        </tr>
    </table>
</div>

<!--第二部分-->
<div id="body_second">
<table>
    <tr>
        <th style="float: left;color: red">| 热门短评</th>
        <th style="float:right;text-align: right"><input id="message_but" value="写短评" name="message_but" type="button" style="font-size: 16px;width: 150px;color: cadetblue;background-color: lightblue;border-color: lightblue;border-radius: 10px"></th>
    </tr>
    <!--第一行-->
    {{range .Messages}}
    <tr>
        <td>
            <div style="float: left"><img src="{{.Sender.ImgPath}}" style="width: 50px;border-radius: 50px;border: 2px solid darkblue"></div>
            <div style="float: left;padding-left: 5px">
                <div style="font-size: 20px;padding-top: 10px">{{.Sender.Username}}</div>
                <div style="color: gray;font-size: 14px">{{.Time}}</div>
            </div>
        </td>
    </tr>

    <!--第二行-->
    <tr>
        <td >
            <div style="margin-left: 60px;">{{.Content}}</div>
        </td>
    </tr>

    <!--第三行-->
    <tr>
        <td>
            <div style="margin-left: 60px;border-bottom: 1px solid gray;">
                <input name="{{.ID}}" class="launch" value="展开评论" type="button" style="width: 60px;padding: 3px;border-radius:5px;border: 1px solid darkblue;font-family: '幼圆';font-size: 14px">
                <div style="float: right;padding-right: 20px">
                    <a href="/toComment?receivedID={{.ID}}&filmName={{.FilmName}}&messageType=1" style="border: 1px solid darkblue;padding: 3px;border-radius: 5px;color: black;">回复</a>
                </div>
            </div>
        </td>
    </tr>

    <!---------------------------------------------------------->
    <tr>
        <td id="{{.ID}}" class="answer">
            <table>
            {{range .Received}}
            <tr>
                <td>
                    <div style="float: left;padding-left: 55px"><img src="{{.Sender.ImgPath}}" style="width: 30px;border-radius: 30px;border: 2px solid darkblue"></div>
                    <div style="float: left;padding-left: 5px">
                        <div style="font-size: 16px;padding-top: 5px">{{.Sender.Username}}</div>
                        <div style="color: gray;font-size: 12px">{{.Time}}</div>
                    </div>
                </td>
            </tr>

            <tr>
                <td>
                    <div style="margin-left: 90px;border-bottom: 1px solid gray;">{{.Content}}</div>
                </td>
            </tr>
            {{end}}
            <!------->
            <tr>
                <td><input name="{{.ID}}" class="pack_up" value="收起评论" type="button" style="float: right;width: 60px;padding: 3px;border-radius:5px;border: 1px solid darkblue;font-family: '幼圆';font-size: 14px"></td>
            </tr>
            </table>
        </td>
    </tr>
    <!---------------------------------------------------------->

    {{else}}
    <tr><td colspan="2" style="text-align: center">┭┮﹏┭┮ ，还没有评论哦，快来写写吧~</td></tr>
    {{end}}
</table>
</div>


<!--尾行-->
<div class="bottom">

    商务合作邮箱：v@maoyan.com 客服电话：10105335 违法和不良信息/涉未成年人有害信息举报电话：4006018900<br>

    用户举报/涉未成年人有害信息举报邮箱：tousujubao@meituan.com 舞弊线索举报邮箱：wubijubao@maoyan.com<br>

    中华人民共和国增值电信业务经营许可证 京B2-20190350 | 营业性演出许可证 京演（机构）（2019）4094号<br>

    广播电视节目制作经营许可证 （京）字第08478号 | 网络文化经营许可证 京网文（2022）1334-041号<br>

    艺术品经营单位备案证明 京东艺（2022）0095号<br>

    猫眼用户服务协议 | 猫眼平台交易规则总则 | 隐私政策<br>

    京公网安备 11010102003232号 | 京ICP备16022489号-1<br>

    北京猫眼文化传媒有限公司<br>

    ©2023 猫眼电影 www.maoyan.com<br>
</div>
</body>
</html>